package experimentation;

import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;

public class Rsa2 extends KeyPairGenerator{
	protected Rsa2() {
		super("RSA");
	}
	
	public static void main (String[] args) throws NoSuchAlgorithmException{
		KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
		kpg.initialize(2048);
		KeyPair kp = kpg.genKeyPair();
		Key publicKey = kp.getPublic();
		Key privateKey = kp.getPrivate();
		System.out.println(publicKey);
		System.out.println(privateKey);
	}
}
